<?php
namespace app\admin\controller;

use app\AdminCollection;
use app\model\Systems;
use My\Tool;
use My\Validate;

class System extends AdminCollection
{

    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $submit = input('submit');
        if ($submit) {
            try {
                $input = input('');
                $data = $input['info'];
                $return = Systems::updateServer($data);
                $this->returnSuccess("提交数据成功");
            } catch (\Exception $e) {
                $this->returnError($e->getMessage());
            }
        } else {
            $findService = Systems::findService();
            $this->assign('findService', $findService);
            return $this->fetch();
        }
    }
}
